<template>
	<div class="counter-action">
		<h2>CounterAction view</h2>
		<h2>Counter: {{ counterStore.counter }}</h2>
		<button @click="changeState">修改state</button>
		<button @click="incrementNum(10)">修改state(参数)</button>

		<ul>
			<template v-for="item in homeStore.banners" :key="item.id">
				<li>{{ item.title }}</li>
			</template>
		</ul>
	</div>
</template>

<script setup>
	import useCounter from '../stores/counter'
	import useHome from '../stores/home'

	const counterStore = useCounter()
	const changeState = () => {
		counterStore.increment()
	}
	const incrementNum = (num) => {
		counterStore.incrementNum(num)
	}

	const homeStore = useHome()
	homeStore.fetchHomeMultidata().then((res) => {
		console.log(res)
	})
</script>

<style scoped></style>
